package com.sc.nft.req.mallCart;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 *
 * @Author：LiGen
 * @Package：com.metago.mallmini.domain.req.cart
 * @Project：meta_mall_mini_app
 * @name：CartIdsReq
 * @Date：2024/5/8 14:47
 * @Filename：CartIdsReq
 */
@Data
public class RemoveCartReq {

    @ApiModelProperty( "购物车Id集合")
    private List<Long> cartIds;

    @ApiModelProperty( "小程序用户Id")
    private Long miniUserId;

    @ApiModelProperty( "是否清空购物车")
    private Boolean isClearAll = false;

    public void check(){
        if (!isClearAll){
            Assert.isTrue(!CollectionUtils.isEmpty(cartIds),"服务器拥挤!");
        }
    }
}
